package com.jdd.modules.userstaff.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.jdd.modules.userstaff.entity.TUserDevice;
import com.jdd.modules.userstaff.mapper.TUserDeviceMapper;
import com.jdd.modules.userstaff.service.ITUserDeviceService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 人员和设备的关系，以及权限。 服务实现类
 * </p>
 *
 * @author ls
 * @since 2022-10-12
 */

@Service
public class TUserDeviceServiceImpl extends ServiceImpl<TUserDeviceMapper, TUserDevice> implements ITUserDeviceService {







    @Override
    public List<TUserDevice> getAllUserDeviceByUserId(String userId) {
        LambdaQueryWrapper<TUserDevice> tUserDeviceLambdaQueryWrapper = new LambdaQueryWrapper<>();
        tUserDeviceLambdaQueryWrapper.eq(TUserDevice::getUserId,userId);
        List<TUserDevice> list = this.list(tUserDeviceLambdaQueryWrapper);
        return list;
    }

    @Override
    public List<TUserDevice> getUserBindedDevice(String userId) {
        LambdaQueryWrapper<TUserDevice> lambdaQueryWrapper = new LambdaQueryWrapper<>();
        lambdaQueryWrapper.eq(TUserDevice::getUserId,userId);
        List<TUserDevice> list = this.list(lambdaQueryWrapper);
        return list;
    }
}
